database = [['a','1111'],
            ['b','2222'],
            ['c','3333'],
            ['d','4444']]

['d','4444'] in database
Out[8]: True

['d','4445'] in database
Out[9]: False
lice', '1111'],
 ['b', '2222'],
 ['d', '4444'],
 ['tom', '8888']]

sorted(db)
Out[26]: 
[['SMITH', '1111'],
 ['alice', '1111'],
 ['b', '2222'],
 ['d', '4444'],
 ['tom', '8888']]

sorted(db,reverse=True)
Out[27]: 
[['tom', '8888'],
 ['d', '4444'],
 ['b', '2222'],
 ['alice', '1111'],
 ['SMITH', '1111']]

db
Out[28]: 
[['SMITH', '1111'],
 ['alice', '1111'],
 ['b', '2222'],
 ['d', '4444'],
 ['tom', '8888']]

for each in db:
    print(each)
    
['SMITH', '1111']
['alice', '1111']
['b', '2222']
['d', '4444']
['tom', '8888']

for each in db:
    print([each[0].upper,each[1]])
    
[<built-in method upper of str object at 0x0000013AAEA72D60>, '1111']
[<built-in method upper of str object at 0x0000013AAEA428E0>, '1111']
[<built-in method upper of str object at 0x00007FFD1F47B010>, '2222']
[<built-in method upper of str object at 0x00007FFD1F47B070>, '4444']
[<built-in method upper of str object at 0x0000013AA1454CC0>, '8888']

for each in db:
    print([each[0].upper(),each[1]])
    
['SMITH', '1111']
['ALICE', '1111']
['B', '2222']
['D', '4444']
['TOM', '8888']

new_db = []

for each in db:    print([each[0].upper,each[1]])
[<built-in method upper of str object at 0x0000013AAEA72D60>, '1111']
[<built-in method upper of str object at 0x0000013AAEA428E0>, '1111']
[<built-in method upper of str object at 0x00007FFD1F47B010>, '2222']
[<built-in method upper of str object at 0x00007FFD1F47B070>, '4444']
[<built-in method upper of str object at 0x0000013AA1454CC0>, '8888']

new_db = []

for each in db:
    print([each[0].upper,each[1]])
    new_db.append(;each[0].upper(),each[1]])
  Cell In[35], line 3
    new_db.append(;each[0].upper(),each[1]])
                                          ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('


for each in db:
    print([each[0].upper,each[1]])
    new_db.append(each[0].upper(),each[1]])
  Cell In[36], line 3
    new_db.append(each[0].upper(),each[1]])
                                         ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('


for each in db:
    print([each[0].upper,each[1]])
    new_db.append([each[0].upper(),each[1]])
    
[<built-in method upper of str object at 0x0000013AAEA72D60>, '1111']
[<built-in method upper of str object at 0x0000013AAEA428E0>, '1111']
[<built-in method upper of str object at 0x00007FFD1F47B010>, '2222']
[<built-in method upper of str object at 0x00007FFD1F47B070>, '4444']
[<built-in method upper of str object at 0x0000013AA1454CC0>, '8888']

new_db2 = [ [each[0].upper(),each[1]]for each in db]

new_db2
Out[39]: 
[['SMITH', '1111'],
 ['ALICE', '1111'],
 ['B', '2222'],
 ['D', '4444'],
 ['TOM', '8888']]